package com.imti.mall.user.service.Impl;


import com.imti.mall.common.Api.CommonResult;
import com.imti.mall.model.user.pojo.UmsMember;
import com.imti.mall.model.user.pojo.UmsMemberMemberTagRelation;
import com.imti.mall.user.mapper.UserMemberMapper;
import com.imti.mall.user.service.UserMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserMemberServiceImpl implements UserMemberService {

    @Autowired
    UserMemberMapper userMemberMapper;


    /**
     * 检验手机号是否使用过
     */
    @Override
    public Integer findPhone(String phone) {
        return userMemberMapper.findPhone(phone);//未被使用过则返回true
    }

    /**
     * 向用户列表中添加用户信息
     * @param umsMember
     * @return Integer
     */
    @Override
    public Integer reg(UmsMember umsMember) {
        return userMemberMapper.saveMember(umsMember);
    }
    /**
     * 用户登录
     * @param umsMember
     * @return boolean
     */
    @Override
    public UmsMember logins(UmsMember umsMember) {
        return userMemberMapper.logins(umsMember);
    }
    /**
     * 找回密码
     * @param umsMember
     * @return boolean
     */
    @Override
    public int changePwd(UmsMember umsMember) {
        return userMemberMapper.changePwd(umsMember);
    }
}

